package net.bwie.realtime.jtp.dws.log.function;

import net.bwie.realtime.jtp.dws.log.bean.PageViewBean;
import org.apache.flink.api.common.functions.ReduceFunction;

public class PageViewReportReduceFunction implements ReduceFunction<PageViewBean> {
    @Override
    public PageViewBean reduce(PageViewBean pageViewBean, PageViewBean t1) throws Exception {
        pageViewBean.setPvCount(pageViewBean.getPvCount() + t1.getPvCount());
        pageViewBean.setPvDuringTime(pageViewBean.getPvDuringTime() + t1.getPvDuringTime());
        pageViewBean.setUvCount(pageViewBean.getUvCount() + t1.getUvCount());
        pageViewBean.setSessionCount(pageViewBean.getSessionCount() + t1.getSessionCount());
        return pageViewBean;
    }
}
